"""
@author: 江同学呀
@file: fielddata_frequency_filter.py
@date: 2024/7/27 23:03
@desc: 
"""
from typing import Dict, Union

from espc.orm.model.base.base import _Base


class FieldDataFrequencyFilter(_Base):
    """
    todo 补充描述
    """
    def __init__(self, min_: float = None, max_: float = None, min_segment_size: int = None, *args, **kwargs):
        super(FieldDataFrequencyFilter, self).__init__(*args, **kwargs)

        self._min: float = min_
        self._max: float = max_
        self._min_segment_size: int = min_segment_size
        return

    def _build(self) -> Dict:
        body: Dict[str, Union[int, float]] = {}
        if self._min is not None:
            body["min"] = self._min
        if self._max is not None:
            body["max"] = self._max
        if self._min_segment_size is not None:
            body["min_segment_size"] = self._min_segment_size
        return body

    # def _to_dict(self) -> Dict:
    #     body: Dict[str, Union[int, float]] = {}
    #     if self._min is not None:
    #         body["min"] = self._min
    #     if self._max is not None:
    #         body["max"] = self._max
    #     if self._min_segment_size is not None:
    #         body["min_segment_size"] = self._min_segment_size
    #     return body


